home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Utilities / Text and Speech / Torquemada the Inquisitor / Prior Read Me Files⁄Examples / Still Newer Stuff / Read Me I < prev    next >
Text File  |  1992-04-23  |  10KB  |  142 lines

  1. Release notes for Torquemada version 1.0.8
  2.  
  3. There's an awful lot that's new this time out. I can say with a fair degree of certainty that this really is _it_ this time, because there's no room left in my current approach for growth. When I get around to writing TQM 2.0, I'll have to come up with a completely different approach.
  4.  
  5. Not so first things first: Shane The Omnipresent recommened me to a freeware text editor/browser called BBEdit. It's actual, primary intended purpose is to be a programmer's editor, but it offers many features that make it ideal for use with Torquemada and XP8. In terms of power (and complexity), it falls perfectly between TeachText and Alpha. It offers many features that I've been going to Word for, without Word's size, sloth and idiocity. Highly recommended!
  6.  
  7. Now then: what's new...
  8.  
  9. First a couple of interface issues. Select All and Clear have been implemented. They work just as you'd expect.
  10.  
  11. And: the About… item in the Apple menu has been made heirarchical to allow for two windows, the normal About Torquemada box, and a new one called Torquemada's Wildcards. This is a quick reference to all of the wildcards, wildstrings and case modifiers (you'll see why this was needed in due course). This window is also available from a button in the dialogs.
  12.  
  13. Due course: there are (count 'em) _eleven_ new wildthings, bringing the total to 29. Broken out by category:
  14.  
  15. CASE MODIFIERS
  16.   ^C or ^c     CONVERT TO ALL CAPS
  17.   ^L or ^l     convert to all lower case
  18.   ^S or ^s     Convert to sentence caps
  19.   ^U or ^u    Convert To Upstyle Caps
  20.   ^D or ^d    Convert to Downstyle Caps
  21.   ^=        Cancel all case conversion
  22.  
  23. These work only in the replace string. Don't worry if you forget and stick one in the search string; I'm filtering for that error and throwing the command away. Also, you don't have to explicity cancel case conversion at the end of the replace string; I'm doing that, also, simply because it's easy to forget. If you're going from one kind of case conversion to another, you don't need to cancel the first; each cancels any other already in effect. So, where you _could_ say 
  24.  
  25. ^C^~^t^=^U^*^p^=
  26.  
  27. cancelling after each
  28.  
  29. ^C^~^t^U^*^p
  30.  
  31. will do the same job just as well.
  32.  
  33. Case conversion is not new to any of us, so I won't bore you with a lot of examples. But there is one kind of situation I want to consider. We know that case conversion by software can only get you _close_ to what you want. Torquemada may surprise you with his intelligence, but it's still only static intelligence based on fixed rules (e.g., 'I' should be capitalized even in Downstyle). Suppose you have a file that comes to you all caps. You need sentence caps, so you would do:
  34.  
  35. ^~        ^S^~
  36.  
  37. At the end of that search, you will have a reasonably decent file in sentence caps. But you will have lost all the proper nouns, except where they begin a sentence. You will have to write another set to grab all the proper nouns and put them back to inital caps. Here is a string that will fix all names that occur in the form of Joe E. Dokes:
  38.  
  39. {space}^&^~{space}^±.{space}^*{space}        {space}^U^&^~{space}^±.{space}^*{space}
  40.  
  41. Upstyle: It's Not Just For Headlines Anymore! This will catch all the names in the form of First I. Last. I wish I could offer help for the others...
  42.  
  43.  
  44. WILDSTRINGS
  45. ^? and ^@
  46.  
  47. These work just like ^* and ^~: match and store any run of characters until the pattern of characters after the wildstring is matched. I added these two more because the first two have proved so powerful. With three of them, you can intelligently code a file that comes in the form of Category, Subcategory, Description:
  48.  
  49. ^~,^*,^?^p        <BI>^~,<B>^*,<I>^?^p
  50.  
  51. You could do something like that with any number of columns, simply by leaving a marker behind. The first search does three columns and marks the fourth (as with a {vertical bar} for instance). Later searches store everything up to the marker, process three more columns again leaving the marker. Truly, if you have something this regular, you should be using Xdata. But if it's not a common thing in your life, this technique will work.
  52.  
  53.  
  54. TYPED WILDCARDS
  55.   ^$        Printable character (not space)
  56.   ^&    Alphanumeric character (not space or punct.)
  57.   ^%    Tabular character (not alphabetical)
  58.  
  59. Like the other typed wildcards, these are useful for establshing uniqueness in search strings. All of the typed wildcards _exclude_ as well as _include_. For example, ^# matches any digit, but also _fails to_ match anything that's _not_ a digit. These three are defined as much by what they are not as what they are; in effect, they make for a sort of poor man's logical NOT. You can, for instance, match any run of space characters with:
  60.  
  61. ^_^~^$
  62.  
  63. This says, in effect, while-not-printable. By popular demand, here's a way to lose all runs of two or more returns:
  64.  
  65. ^p^~^$        ^p^$
  66.  
  67. Likewise, convert any runs of three or more spaces to a tab:
  68.  
  69. {space}{space}{space}^~^$        ^t^$
  70.  
  71. Definitions: a Printable character is one that makes marks on a printed page. All space-modifiers are are _not_ Printable characters. (This differs from C usage, so C hacks might be more comfortable thinking of this type as Graphic.)
  72.  
  73. An Alphanumeric character is any upper or lower case letter or any digit. All space modifiers and punctuation characters are omitted from this category.
  74.  
  75. A Tabular character is any digit, any space modifier or any punctuation character. Upper and lower case letters are omitted from this group.
  76.  
  77.  
  78. Hints, tips, and admonitions:
  79.  
  80. • God is in the details: all of the typed wildcards match both seven- and eight-bit characters of their type. In other words, ^! will match a dagger as well as a semi-colon. The new case conversion commands also take account of eight-bit characters; É will convert to é, for example. However: this is not _wholly_ a boon: if you are processing XPress Tags you need to make sure that you don't convert any eight-bit dingbat characters that might happen to use slots occupied by letters in text fonts. And: nothing intelligent is being done about ligatures. If you have ligs in your jobs, you will need to convert them in a search prior to going to all caps.
  81.  
  82. • Same neighborhood. Case conversion will ignore anything nested inside angle brackets. This is to avoid toasting XPress Tags, which are case sensitive. If you are processing text that uses angle brackets _as text_, you need to convert them to something else temporarily, prior to doing case conversion. We also ignore anything between an @ sign and a colon, for the same reason. And we ignore text that takes the form of [a1] (square open bracket, lowercase letter, digit(s), square close bracket), which is the only type of XP8 command that is case-sensitive.
  83.  
  84. • As you can see in the Quick Reference below, Torquemada can present a pretty intimidating face to the universe. But, truly, you don't need to feel like you have to do a lot of Gee Whiz stuff to use the Inquisitor. If you feel comfortable with literal search and replace, but not so comfortable with all this Wildness, that's fine. Likewise, if you have use for the occasional wildcard, but aren't confident with the wildstrings, don't feel compelled to use them. The more you use the software, the more confident you'll become with it.
  85.  
  86. • On the other hand, if you're wild about Wildness, there's enough here to keep you sated for a while. I've presented enough examples of intelligent ignorance-management to shave many hours from your work week. But if you need still more power, let me leave you with this thought: markers. Using markers and the typed wildcards, you can solve many, many text management problems that would otherwise require custom software or even (horrors!) manual labor. The trick, when you can't fully resolve all doubts with the first search, is to leave clear-cut clues behind for later searches to act upon. Clean up when you're done, and you're really done; with my own work, I'm aiming toward fully coding (XPress Tagging) text with _no_ manual editing.
  87.  
  88.  
  89. Twenty search and replace strings, ten untyped wildcards, nine typed wildcards, four wildstrings, and six case conversion commands... (I wasn't expecting the Spanish Inquisition... (grin)) _Now_ this elf _really_ needs a manual. Someday soon... Sooner than GREP, in any event...
  90.  
  91. Very Best,
  92.  
  93. Greg Swann
  94. 4/22/92
  95.  
  96.  
  97. P.S.: Some final thoughts.
  98.  
  99. There is one commented set that is new with this archive. It reformats MS-DOS like files in a rudimentary sort of way; five minutes of effort would make it a lot more exhaustive in its trapping, particularly if those five minutes are devoted to the quirks of a specific file. I just ran it on an espeicially bogus financial file I keep around for testing purposes, and it did a real nice job.
  100.  
  101. And: I am very interested in seeing real-world examples of case-conversion errors. Of the five types in Torquemada, CAPS and lowercase are bulletproof. Upstyle is very, very hard to fool. Downstyle is as good as it can be without a look-up table. Sentence capitalization is the problem child. It does nice, except in extremely ambiguous cases. _That's_ what I'd like to see. I'm interested in developing better rules for this stuff. Case conversion is never going to be as hard to fool as is quote conversion, but my feeling is that I can do better...
  102.  
  103. ...which implies... there may be another Torquemada... Yes, I'm an idiot. A fool for love is still a fool. (grin)
  104.  
  105. --GSS
  106. 4/23/92
  107.  
  108.  
  109.  
  110.  
  111. TORQUEMADA QUICK REFERENCE
  112.  
  113. ALIASES—Match special text characters
  114.   ^T or ^t    Tab
  115.   ^P or ^p    Carriage return
  116.   ^^                Caret
  117.  
  118. UNTYPED WILDCARDS—Match any one character
  119.   ^0, ^1, ^2, ^3, ^4, ^5, ^6, ^7, ^8, ^9
  120.  
  121. TYPED WILDCARDS—Match any one char. of that type
  122.   ^+    Uppercase character
  123.   ^-        Lowercase character
  124.   ^±    Character of either case
  125.   ^&    Alphanumeric character (not space or punct.)
  126.   ^%    Tabular character (not alphabetical)
  127.   ^$        Printable character (not space)
  128.   ^!        Punctuation character
  129.   ^#        Numeric character (digits only)
  130.   ^_        Space character (space, ret., tab, opt. space)
  131.  
  132. WILDSTRINGS—Match and store any text until full pattern is matched
  133.   ^*, ^~, ^?, ^@
  134.  
  135. CASE CONVERSION COMMANDS—Can be used only on the replace side
  136.   ^C or ^c    CONVERT TO ALL CAPS
  137.   ^L or ^l     convert to all lower case
  138.   ^S or ^s    Convert to sentence caps
  139.   ^U or ^u    Convert To Upstyle Caps
  140.   ^D or ^d    Convert to Downstyle Caps
  141.   ^=               Cancel all case conversion
  142.